<template>
  <div class="page">
    <div class="layui-fluid">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
          <div class="layui-card">
            <div class="layui-card-body">
              <div class="layui-form" lay-filter="">

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">应用名称</label>
                    <div class="layui-input-inline">
                      <input type="text" name="applyName" placeholder="请输入名称" autocomplete="off" class="layui-input"
                        v-model="itemData.applyName" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">APPID</label>
                    <div class="layui-input-inline">
                      <input type="text" name="appId" placeholder="请输入小程序APPID" autocomplete="off" class="layui-input"
                        v-model="itemData.appId" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">安卓地址</label>
                    <div class="layui-input-inline android">
                      <input type="text" name="androidAddress" placeholder="请输入地址" autocomplete="off"
                        class="layui-input" v-model="itemData.androidAddress" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">安卓版本号</label>
                    <div class="layui-input-inline">
                      <input type="text" name="androidVersion" placeholder="请输入版本号" autocomplete="off"
                        class="layui-input" v-model="itemData.androidVersion" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">苹果地址</label>
                    <div class="layui-input-inline">
                      <input type="text" name="appleAddress" placeholder="请输入地址" autocomplete="off" class="layui-input"
                        v-model="itemData.appleAddress" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">苹果版本号</label>
                    <div class="layui-input-inline">
                      <input type="text" name="appleVersion" placeholder="请输入版本号" autocomplete="off" class="layui-input"
                        v-model="itemData.appleVersion" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">小程序源码地址</label>
                    <div class="layui-input-inline ">
                      <input type="text" name="appletPackageAddress" placeholder="请输入地址" autocomplete="off"
                        class="layui-input" v-model="itemData.appletPackageAddress" disabled="ture">
                    </div>
                  </div>
                </div>

                <div class="layui-form-item layui-form-text">
                  <label class="layui-form-label">备注</label>
                  <div class="layui-input-block">
                    <textarea placeholder="请输入内容" class="layui-textarea" v-model="itemData.remarks"
                      disabled="ture"></textarea>
                  </div>
                </div>

                <div class="layui-form-item">
                  <label class="layui-form-label">审核状态</label>
                  <div class="layui-input-inline">
                    <select name="auditStatus" lay-filter="auditStatus" v-model="itemData.auditStatus" disabled="ture">
                      <option value="UNAUDITED">待审核</option>
                      <option value="AUDIT_PASS">审核通过</option>
                      <option value="AUDIT_FAILED">审核不通过</option>
                    </select>
                  </div>
                </div>

                <div class="layui-form-item">
                  <div class="layui-inline">
                    <label class="layui-form-label">下载应用</label>
                    <div class="layui-input-block">
                      <a :href="itemData.androidAddress" download="安卓地址" type="button"
                        class="layui-btn layui-btn-normal"> 安卓 </a>
                      <a :href="itemData.appleAddress" download="苹果地址" type="button"
                        class="layui-btn layui-btn-warm">苹果</a>
                      <a :href="itemData.appletPackageAddress" download="小程序地址" type="button"
                        class="layui-btn layui-btn-danger"> 小程序
                      </a>
                    </div>
                  </div>

                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "shopdw",
  data () {
    return {
      id: "",
      itemData: {
        applyName: '',//应用名称
        appId: '',// appID
        androidAddress: '',//安卓地址
        androidVersion: '',//安卓版本号
        appleAddress: '',//苹果地址
        appleVersion: '',//苹果版本号
        appletPackageAddress: '',//小程序APPID地址
        remarks: '',//备注
        auditStatus: ''//审核状态
      },
    };
  },
  mounted () {
    var vm = this;
    window.getdates = this.getdates;
  },
  methods: {
    getdates: function (data) {
      var vm = this;
      var url = "/advert/bapi/v1.9/apply-setting/byDealer/apply";
      ajaxRequest(url, "GET", "json", "", function (ret, err) {
        if (ret.data != null) {
          vm.itemData = ret.data;
        }
      });
    },

  },
  updated: function () {
    var vm = this;
    layui.use("form", function () {
      var form = layui.form;
      form.render();
      form.on("select(auditStatus)", function (data) {
        vm.itemData.auditStatus = data.value;
      });
    });
  },
};
</script>
<style scoped>
.layui-form-label {
  font-size: 15px;
}
</style>
